'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  // 用于测试
  async index1() {
    const { app, ctx, service } = this;
    const _tokenAddress = 'TU2MR8w2JVZdqBnK3dRV4HaAwhKjTspABd';
    const factoryContract = app.Init.factoryContract;
    let res2 = await factoryContract.methods.getExchange(_tokenAddress).call();
    console.log(res2);
    res2 = await service.eth.addressFromHex(res2);
    console.log(res2);
    ctx.body = {code: 200, msg: 'HNFT 项目 trx, 不调用数据库'};
  }


}

module.exports = HomeController;
